library(RWeka)
source('./src/prepare.r')

knn.cl <- IBk(as.factor(d.label) ~., data = d.data, control = Weka_control(K = 1))

accuracy <- c()
knn.pr <- predict(knn.cl, t.data)
accuracy <- append(accuracy, sum(knn.pr == t.label) / length(t.label))
